// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request';
// 定义 API 路径枚举
enum Api {
    SysConfigPage = '/SysConfig/pages',
    SysConfigAdd = '/SysConfig/AddData',
    SysConfigUpdate = '/SysConfig/UpdateData',
    SysConfigDelete = '/SysConfig/DeleteData',
    SysConfigBatchDelete = '/SysConfig/BatchDelete',
    SysConfigBatchUpdate = '/SysConfig/batchUpdate',
    SysConfigDetail = '/SysConfig/detail',
    SysConfigGroupList = '/SysConfig/groupList',
    SysConfigList = '/SysConfig/list',
    SysConfigSaveSysInfo = '/SysConfig/saveSysInfo',
    SysConfigSysInfo = '/SysConfig/sysInfo',
}

// 定义 API 方法
/**
 * 增加参数配置 🔖
 * @param body 请求体
 */
export const apiSysConfigAddPost = (body?: any) =>
    request({
        url: Api.SysConfigAdd,
        method: 'post',
        data: body,
    });

/**
 * 批量删除参数配置 🔖
 * @param body 请求体
 */
export const apiSysConfigBatchDeletePost = (body?: number[]) =>
    request({
        url: Api.SysConfigBatchDelete,
        method: 'post',
        data: body,
    });

/**
 * 批量更新参数配置值
 * @param body 请求体
 */
export const apiSysConfigBatchUpdatePost = (body?: any[]) =>
    request({
        url: Api.SysConfigBatchUpdate,
        method: 'post',
        data: body,
    });

/**
 * 删除参数配置 🔖
 * @param body 请求体
 */
export const apiSysConfigDeletePost = (body?: any) =>
    request({
        url: Api.SysConfigDelete,
        method: 'Delete',
        data: body,
    });

/**
 * 获取参数配置详情 🔖
 * @param id 主键Id
 */
export const apiSysConfigDetailGet = (id: number) =>
    request({
        url: Api.SysConfigDetail,
        method: 'get',
        params: { Id: id },
    });

/**
 * 获取分组列表 🔖
 */
export const apiSysConfigGroupListGet = () =>
    request({
        url: Api.SysConfigGroupList,
        method: 'get',
    });

/**
 * 获取参数配置列表 🔖
 * @param body 请求体
 */
export const apiSysConfigListPost = (body?: any) =>
    request({
        url: Api.SysConfigList,
        method: 'post',
        data: body,
    });

/**
 * 获取参数配置分页列表 🔖
 * @param body 请求体
 */
export const apiSysConfigPagePost = (body?: any) =>
    request({
        url: Api.SysConfigPage,
        method: 'get',
        data: body,
    });

/**
 * 保存系统信息 🔖
 * @param body 请求体
 */
export const apiSysConfigSaveSysInfoPost = (body?: any) =>
    request({
        url: Api.SysConfigSaveSysInfo,
        method: 'post',
        data: body,
    });

/**
 * 获取系统信息 🔖
 */
export const apiSysConfigSysInfoGet = () =>
    request({
        url: Api.SysConfigSysInfo,
        method: 'get',
    });

/**
 * 更新参数配置 🔖
 * @param body 请求体
 */
export const apiSysConfigUpdatePost = (body?: any) =>
    request({
        url: Api.SysConfigUpdate,
        method: 'put',
        data: body,
    });